<template>
	<view>
		<view class="back-w" style="">
			<view class="u-m-l-10" @click="Back()">
				<u-icon name="arrow-left" color="#000000" size="20"></u-icon>
			</view>
			<view class="f-w-l">
				详情
			</view>
		</view>
		<view style="border-top: 1px solid #eee;margin-top: 40rpx;"></view>
		<view class="content" style="margin-top: 50rpx;">
			<view class="title">{{title}}</view>
			<rich-text :nodes="datalist"></rich-text>
		</view>
		<view class="" v-show="this.questionsId==''">
			<u-empty mode="data" width="150" marginTop="50%" textSize="25rpx"
				icon="http://cdn.uviewui.com/uview/empty/list.png">
			</u-empty>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				questionsId: '',
				datalist: '',
				title: ''
			}
		},
		onLoad(option) {
			this.questionsId = option.questionsId;
		},
		created() {
			this.getlist()
		},
		methods: {
			getlist() {
				this.$http('ours.viewQuestions', {
					questionsId: this.questionsId
				}).then(res => {
					console.log(res)
					if (res.code == 200) {
						this.title = res.data.title;
						this.datalist = res.data.details;
						console.log(this.datalist);
					} else {
						uni.showToast({
							icon: "error",
							title: res.msg
						})
					}
				})
			},
			Back() {
				let pageNum = 2
				let pages = getCurrentPages(); // 当前页面
				let beforePage = pages[pages.length - pageNum];
				uni.navigateBack({
					success: function() {
						console.log(beforePage)
						beforePage.$vm.$refs.problem.getlist();
					}

				})
			},
		}
	}
</script>

<style scoped lang="css">
	.back-w {
		display: flex;
		flex-direction: row;
		padding-top: 50rpx;
		/* align-items: center; */
		width: 100vw;
		height: 90rpx;
		background-color: #ffffff;
	}

	.f-w-l {
		display: flex;
		flex-direction: row;
		font-weight: bold;
		margin-left: 40%;
	}

	.content {
		width: 95%;
		margin: 0 auto;
		font-size: 30rpx;
		color: #666;
	}

	.content img {
		width: 80%;
		height: 80%;
		margin-left: 5%;
		margin-top: 20rpx;
		margin-bottom: 20rpx;
	}

	.content p {
		text-indent: 50rpx;
	}

	.title {
		font-size: 34rpx;
		font-weight: 600;
		margin-bottom: 40rpx;
	}

	.uni-collapse-item__wrap-content {
		height: 80rpx;
		width: 80%;
		margin: 0 auto;
		font-size: 20rpx;
	}
</style>
